package ben.samplegame.rules;

import game.engine.GameRule;
import game.physics.ImpulseVector;
import game.sprite.Background;
import game.sprite.MovableSprite;
import game.sprite.Sprite;
import java.awt.Point;
import java.util.ArrayList;
import ben.samplegame.sprite.SampleLevel;

public class SpawnRule implements GameRule {
    private SampleLevel myLevel;
   private final int SPAWN_FRAMES = 100;
   private final int SPAWN_COUNT =10;
   private int spawnCounter = 0;
    private int frameCounter =0;

    public SpawnRule(SampleLevel level){
        myLevel = level;
    }

    @Override
    public void checkRules() {
        if(spawnCounter==10){
            myLevel.setWon(true);
        }
        else if(frameCounter>SPAWN_FRAMES){
            myLevel.spawnEnemy();
            frameCounter = 0;
            spawnCounter++;
        }
        frameCounter++;
        
       
        
    }


}


